OpenHMD
 
Loading...
Searching...
No Matches
openhmd.h
Go to the documentation of this file.
1/*
2 * OpenHMD - Free and Open Source API and drivers for immersive technology.
3 * Copyright (C) 2013 Fredrik Hultin.
4 * Copyright (C) 2013 Jakob Bornecrantz.
5 * Distributed under the Boost 1.0 licence, see LICENSE for full text.
6 */
7
8/**
9 * \file openhmd.h
10 * Main header for OpenHMD public API.
11 **/
12
13#ifndef OPENHMD_H
14#define OPENHMD_H
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20#ifdef _WIN32
21#ifdef DLL_EXPORT
22#define OHMD_APIENTRY __cdecl
23#define OHMD_APIENTRYDLL __declspec( dllexport )
24#else
25#ifdef OHMD_STATIC
26#define OHMD_APIENTRY __cdecl
27#define OHMD_APIENTRYDLL
28#else
29#define OHMD_APIENTRY __cdecl
30#define OHMD_APIENTRYDLL __declspec( dllimport )
31#endif
32#endif
33#else
34#define OHMD_APIENTRY
35#define OHMD_APIENTRYDLL __attribute__((visibility("default")))
36#endif
37
38/** Maximum length of a string, including termination, in OpenHMD. */
39#define OHMD_STR_SIZE 256
40
41/** Return status codes, used for all functions that can return an error. */
42typedef enum {
43 OHMD_S_OK = 0,
44 OHMD_S_UNKNOWN_ERROR = -1,
45 OHMD_S_INVALID_PARAMETER = -2,
46 OHMD_S_UNSUPPORTED = -3,
47 OHMD_S_INVALID_OPERATION = -4,
48
49 /** OHMD_S_USER_RESERVED and below can be used for user purposes, such as errors within ohmd wrappers, etc. */
52
53/** A collection of string value information types, used for getting information with ohmd_list_gets(). */
54typedef enum {
55 OHMD_VENDOR = 0,
56 OHMD_PRODUCT = 1,
57 OHMD_PATH = 2,
59
60/** A collection of string descriptions, used for getting strings with ohmd_gets(). */
61typedef enum {
62 OHMD_GLSL_DISTORTION_VERT_SRC = 0,
63 OHMD_GLSL_DISTORTION_FRAG_SRC = 1,
64 OHMD_GLSL_330_DISTORTION_VERT_SRC = 2,
65 OHMD_GLSL_330_DISTORTION_FRAG_SRC = 3,
66 OHMD_GLSL_ES_DISTORTION_VERT_SRC = 4,
67 OHMD_GLSL_ES_DISTORTION_FRAG_SRC = 5,
69
70/** Standard controls. Note that this is not an index into the control state.
71 Use OHMD_CONTROL_TYPES to determine what function a control serves at a given index. */
72typedef enum {
73 OHMD_GENERIC = 0,
74 OHMD_TRIGGER = 1,
75 OHMD_TRIGGER_CLICK = 2,
76 OHMD_SQUEEZE = 3,
77 OHMD_MENU = 4,
78 OHMD_HOME = 5,
79 OHMD_ANALOG_X = 6,
80 OHMD_ANALOG_Y = 7,
81 OHMD_ANALOG_PRESS = 8,
82 OHMD_BUTTON_A = 9,
83 OHMD_BUTTON_B = 10,
84 OHMD_BUTTON_X = 11,
85 OHMD_BUTTON_Y = 12,
86 OHMD_VOLUME_PLUS = 13,
87 OHMD_VOLUME_MINUS = 14,
88 OHMD_MIC_MUTE = 15,
90
91/** Control type. Indicates whether controls are digital or analog. */
92typedef enum {
93 OHMD_DIGITAL = 0,
94 OHMD_ANALOG = 1
96
97
98/**
99 * Define that says VELOCITY and ACCELERATION properties are available in this API
100 */
101#define OHMD_HAVE_VEL_ACCEL_API_v0
102
103/**
104 * Define that says ANGULAR VELOCITY and ANGULAR ACCELERATION properties are available in this API
105 */
106#define OHMD_HAVE_VEL_ACCEL_API_v1
107
108/** A collection of float value information types, used for getting and setting information with
109 ohmd_device_getf() and ohmd_device_setf(). */
110typedef enum {
111 /** float[4] (get): Absolute rotation of the device, in space, as a quaternion (x, y, z, w). */
113
114 /** float[16] (get): A "ready to use" OpenGL style 4x4 matrix with a modelview matrix for the
115 left eye of the HMD. */
117 /** float[16] (get): A "ready to use" OpenGL style 4x4 matrix with a modelview matrix for the
118 right eye of the HMD. */
120
121 /** float[16] (get): A "ready to use" OpenGL style 4x4 matrix with a projection matrix for the
122 left eye of the HMD. */
124 /** float[16] (get): A "ready to use" OpenGL style 4x4 matrix with a projection matrix for the
125 right eye of the HMD. */
127
128 /** float[3] (get): A 3-D vector representing the absolute position of the device, in space. */
130
131 /** float[1] (get): Physical width of the device screen in metres. */
133 /** float[1] (get): Physical height of the device screen in metres. */
135
136 /** float[1] (get): Physical separation of the device lenses in metres. */
138 /** float[1] (get): Physical vertical position of the lenses in metres. */
140
141 /** float[1] (get): Physical field of view for the left eye in degrees. */
143 /** float[1] (get): Physical display aspect ratio for the left eye screen. */
145 /** float[1] (get): Physical field of view for the left right in degrees. */
147 /** float[1] (get): Physical display aspect ratio for the right eye screen. */
149
150 /** float[1] (get, set): Physical interpupillary distance of the user in metres. */
152
153 /** float[1] (get, set): Z-far value for the projection matrix calculations (i.e. drawing distance). */
155 /** float[1] (get, set): Z-near value for the projection matrix calculations (i.e. close clipping distance). */
157
158 /** float[6] (get): Device specific distortion value. */
160
161 /**
162 * float[10] (set): Perform sensor fusion on values from external sensors.
163 *
164 * Values are: dt (time since last update in seconds) X, Y, Z gyro, X, Y, Z accelerometer and X, Y, Z magnetometer.
165 **/
167
168 /** float[4] (get): Universal shader distortion coefficients (PanoTools model <a,b,c,d>. */
170
171 /** float[3] (get): Universal shader aberration coefficients (post warp scaling <r,g,b>. */
173
174 /** float[OHMD_CONTROL_COUNT] (get): Get the state of the device's controls. */
176
177 /** float[3] (get): A 3-D vector representing the velocity of the device (m/s). */
179
180 /** float[3] (get): A 3-D vector representing the acceleration of the device (m/s^2). */
182
183 /** float[3] (get): A 3-D vector representing the angular velocity of the device (rad/s). */
185
186 /** float[3] (get): A 3-D vector representing the angular acceleration of the device (rad/s^2). */
189
190/** A collection of int value information types used for getting information with ohmd_device_geti(). */
191typedef enum {
192 /** int[1] (get, ohmd_geti()): Physical horizontal resolution of the device screen. */
194 /** int[1] (get, ohmd_geti()): Physical vertical resolution of the device screen. */
196
197 /** int[1] (get, ohmd_geti()/ohmd_list_geti()): Gets the class of the device. See: ohmd_device_class. */
199 /** int[1] (get, ohmd_geti()/ohmd_list_geti()): Gets the flags of the device. See: ohmd_device_flags. */
201
202 /** int[1] (get, ohmd_geti()): Get the number of analog and digital controls of the device. */
204
205 /** int[OHMD_CONTROL_COUNT] (get, ohmd_geti()): Get what function controls serve. */
207
208 /** int[OHMD_CONTROL_COUNT] (get, ohmd_geti()): Get whether controls are digital or analog. */
211
212/** A collection of data information types used for setting information with ohmd_set_data(). */
213typedef enum {
214 /** void* (set): Set void* data for use in the internal drivers. */
216 /**
217 * ohmd_device_properties* (set):
218 * Set the device properties based on the ohmd_device_properties struct for use in the internal drivers.
219 *
220 * This can be used to fill in information about the device internally, such as Android, or for setting profiles.
221 **/
224
225typedef enum {
226 /** int[1] (set, default: 1): Set this to 0 to prevent OpenHMD from creating background threads to do automatic device ticking.
227 Call ohmd_update(); must be called frequently, at least 10 times per second, if the background threads are disabled. */
230
231/** Device classes. */
232typedef enum
233{
234 /** HMD device. */
236 /** Controller device. */
238 /** Generic tracker device. */
241
242/** Device flags. */
243typedef enum
244{
245 /** Device is a null (dummy) device. */
247 OHMD_DEVICE_FLAGS_POSITIONAL_TRACKING = 2,
248 OHMD_DEVICE_FLAGS_ROTATIONAL_TRACKING = 4,
249 OHMD_DEVICE_FLAGS_LEFT_CONTROLLER = 8,
250 OHMD_DEVICE_FLAGS_RIGHT_CONTROLLER = 16,
251 OHMD_DEVICE_FLAGS_HAPTIC_FEEDBACK = 32,
253
254/** An opaque pointer to a context structure. */
256
257/** An opaque pointer to a structure representing a device, such as an HMD. */
259
260/** An opaque pointer to a structure representing arguments for a device. */
262
263/**
264 * Create an OpenHMD context.
265 *
266 * @return a pointer to an allocated ohmd_context on success or NULL if it fails.
267 **/
268OHMD_APIENTRYDLL ohmd_context* OHMD_APIENTRY ohmd_ctx_create(void);
269
270/**
271 * Destroy an OpenHMD context.
272 *
273 * ohmd_ctx_destroy de-initializes and de-allocates an OpenHMD context allocated with ohmd_ctx_create.
274 * All devices associated with the context are automatically closed.
275 *
276 * @param ctx The context to destroy.
277 **/
278OHMD_APIENTRYDLL void OHMD_APIENTRY ohmd_ctx_destroy(ohmd_context* ctx);
279
280/**
281 * Get the last error as a human readable string.
282 *
283 * If a function taking a context as an argument (ohmd_context "methods") returns non-successfully,
284 * a human readable error message describing what went wrong can be retrieved with this function.
285 *
286 * @param ctx The context to retrieve the error message from.
287 * @return a pointer to the error message.
288 **/
289OHMD_APIENTRYDLL const char* OHMD_APIENTRY ohmd_ctx_get_error(ohmd_context* ctx);
290
291/**
292 * Update a context.
293 *
294 * Update the values for the devices handled by a context.
295 *
296 * If background threads are disabled, this performs tasks like pumping events from the device. The exact details
297 * are up to the driver but try to call it quite frequently.
298 * Once per frame in a "game loop" should be sufficient.
299 * If OpenHMD is handled in a background thread in your program, calling ohmd_ctx_update and then sleeping for 10-20 ms
300 * is recommended.
301 *
302 * @param ctx The context that needs updating.
303 **/
304OHMD_APIENTRYDLL void OHMD_APIENTRY ohmd_ctx_update(ohmd_context* ctx);
305
306/**
307 * Probe for devices.
308 *
309 * Probes for and enumerates supported devices attached to the system.
310 *
311 * @param ctx A context with no currently open devices.
312 * @return the number of devices found on the system.
313 **/
314OHMD_APIENTRYDLL int OHMD_APIENTRY ohmd_ctx_probe(ohmd_context* ctx);
315
316/**
317 * Get string from openhmd.
318 *
319 * Gets a string from OpenHMD. This is where non-device specific strings reside.
320 * This is where the distortion shader sources can be retrieved.
321 *
322 * @param type The name of the string to fetch. One of OHMD_GLSL_DISTORTION_FRAG_SRC, and OHMD_GLSL_DISTORTION_FRAG_SRC.
323 * @param out The location to return a const char*
324 * @return 0 on success, <0 on failure.
325 **/
326OHMD_APIENTRYDLL int ohmd_gets(ohmd_string_description type, const char** out);
327
328/**
329 * Get device description from enumeration list index.
330 *
331 * Gets a human readable device description string from a zero indexed enumeration index
332 * between 0 and (max - 1), where max is the number ohmd_ctx_probe returned
333 * (i.e. if ohmd_ctx_probe returns 3, valid indices are 0, 1 and 2).
334 * The function can return three types of data. The vendor name, the product name and
335 * a driver specific path where the device is attached.
336 *
337 * ohmd_ctx_probe must be called before calling ohmd_list_gets.
338 *
339 * @param ctx A (probed) context.
340 * @param index An index, between 0 and the value returned from ohmd_ctx_probe.
341 * @param type The type of data to fetch. One of OHMD_VENDOR, OHMD_PRODUCT and OHMD_PATH.
342 * @return a string with a human readable device name.
343 **/
344OHMD_APIENTRYDLL const char* OHMD_APIENTRY ohmd_list_gets(ohmd_context* ctx, int index, ohmd_string_value type);
345
346
347/**
348 * Get integer value from enumeration list index.
349 *
350 *
351 *
352 * ohmd_ctx_probe must be called before calling ohmd_list_gets.
353 *
354 * @param ctx A (probed) context.
355 * @param index An index, between 0 and the value returned from ohmd_ctx_probe.
356 * @param type What type of value to retrieve, ohmd_int_value section for more information.
357 * @return 0 on success, <0 on failure.
358 **/
359OHMD_APIENTRYDLL int OHMD_APIENTRY ohmd_list_geti(ohmd_context* ctx, int index, ohmd_int_value type, int* out);
360
361/**
362 * Open a device.
363 *
364 * Opens a device from a zero indexed enumeration index between 0 and (max - 1)
365 * where max is the number ohmd_ctx_probe returned (i.e. if ohmd_ctx_probe returns 3,
366 * valid indices are 0, 1 and 2).
367 *
368 * ohmd_ctx_probe must be called before calling ohmd_list_open_device.
369 *
370 * @param ctx A (probed) context.
371 * @param index An index, between 0 and the value returned from ohmd_ctx_probe.
372 * @return a pointer to an ohmd_device, which represents a hardware device, such as an HMD.
373 **/
374OHMD_APIENTRYDLL ohmd_device* OHMD_APIENTRY ohmd_list_open_device(ohmd_context* ctx, int index);
375
376/**
377 * Open a device with additional settings provided.
378 *
379 * Opens a device from a zero indexed enumeration index between 0 and (max - 1)
380 * where max is the number ohmd_ctx_probe returned (i.e. if ohmd_ctx_probe returns 3,
381 * valid indices are 0, 1 and 2).
382 *
383 * ohmd_ctx_probe must be called before calling ohmd_list_open_device.
384 *
385 * @param ctx A (probed) context.
386 * @param index An index, between 0 and the value returned from ohmd_ctx_probe.
387 * @param settings A pointer to a device settings struct.
388 * @return a pointer to an ohmd_device, which represents a hardware device, such as an HMD.
389 **/
390OHMD_APIENTRYDLL ohmd_device* OHMD_APIENTRY ohmd_list_open_device_s(ohmd_context* ctx, int index, ohmd_device_settings* settings);
391
392/**
393 * Specify int settings in a device settings struct.
394 *
395 * @param settings The device settings struct to set values to.
396 * @param key The specefic setting you wish to set.
397 * @param value A pointer to an int or int array (containing the expected number of elements) with the value(s) you wish to set.
398 **/
399OHMD_APIENTRYDLL ohmd_status OHMD_APIENTRY ohmd_device_settings_seti(ohmd_device_settings* settings, ohmd_int_settings key, const int* val);
400
401/**
402 * Create a device settings instance.
403 *
404 * @param ctx A pointer to a valid ohmd_context.
405 * @return a pointer to an allocated ohmd_context on success or NULL if it fails.
406 **/
408
409/**
410 * Destroy a device settings instance.
411 *
412 * @param ctx The device settings instance to destroy.
413 **/
414OHMD_APIENTRYDLL void OHMD_APIENTRY ohmd_device_settings_destroy(ohmd_device_settings* settings);
415
416/**
417 * Close a device.
418 *
419 * Closes a device opened by ohmd_list_open_device. Note that ohmd_ctx_destroy automatically closes any open devices
420 * associated with the context being destroyed.
421 *
422 * @param device The open device.
423 * @return 0 on success, <0 on failure.
424 **/
425OHMD_APIENTRYDLL int OHMD_APIENTRY ohmd_close_device(ohmd_device* device);
426
427/**
428 * Get a floating point value from a device.
429 *
430 *
431 * @param device An open device to retrieve the value from.
432 * @param type What type of value to retrieve, see ohmd_float_value section for more information.
433 * @param[out] out A pointer to a float, or float array where the retrieved value should be written.
434 * @return 0 on success, <0 on failure.
435 **/
436OHMD_APIENTRYDLL int OHMD_APIENTRY ohmd_device_getf(ohmd_device* device, ohmd_float_value type, float* out);
437
438/**
439 * Set a floating point value for a device.
440 *
441 * @param device An open device to set the value in.
442 * @param type What type of value to set, see ohmd_float_value section for more information.
443 * @param in A pointer to a float, or float array where the new value is stored.
444 * @return 0 on success, <0 on failure.
445 **/
446OHMD_APIENTRYDLL int OHMD_APIENTRY ohmd_device_setf(ohmd_device* device, ohmd_float_value type, const float* in);
447
448/**
449 * Get an integer value from a device.
450 *
451 * @param device An open device to retrieve the value from.
452 * @param type What type of value to retrieve, ohmd_int_value section for more information.
453 * @param[out] out A pointer to an integer, or integer array where the retrieved value should be written.
454 * @return 0 on success, <0 on failure.
455 **/
456OHMD_APIENTRYDLL int OHMD_APIENTRY ohmd_device_geti(ohmd_device* device, ohmd_int_value type, int* out);
457
458/**
459 * Set an integer value for a device.
460 *
461 * @param device An open device to set the value in.
462 * @param type What type of value to set, see ohmd_float_value section for more information.
463 * @param in A pointer to a int, or int array where the new value is stored.
464 * @return 0 on success, <0 on failure.
465 **/
466OHMD_APIENTRYDLL int OHMD_APIENTRY ohmd_device_seti(ohmd_device* device, ohmd_int_value type, const int* in);
467
468/**
469 * Set an void* data value for a device.
470 *
471 * @param device An open device to set the value in.
472 * @param type What type of value to set, see ohmd_float_value section for more information.
473 * @param in A pointer to the void* casted object.
474 * @return 0 on success, <0 on failure.
475 **/
476OHMD_APIENTRYDLL int OHMD_APIENTRY ohmd_device_set_data(ohmd_device* device, ohmd_data_value type, const void* in);
477
478/**
479 * Define that indicates haptics API is available in this OpenHMD
480 */
481#define OHMD_HAVE_HAPTICS_API_v0
482
483/**
484 * Turn on haptics for a device with OHMD_DEVICE_FLAGS_HAPTIC_FEEDBACK flag
485 *
486 * @param device An open device to control haptics on
487 * @param duration The duration of the haptic pulse in seconds
488 * @param frequency The frequency of the vibration in Hz
489 * @param amplitude Haptic amplitude between 0 and 1.0
490 */
491OHMD_APIENTRYDLL int OHMD_APIENTRY ohmd_device_set_haptics_on(ohmd_device* device, float duration, float frequency, float amplitude);
492
493/**
494 * Immediately cancel and turn off any haptics for a device with OHMD_DEVICE_FLAGS_HAPTIC_FEEDBACK flag
495 */
496OHMD_APIENTRYDLL int OHMD_APIENTRY ohmd_device_set_haptics_off(ohmd_device* device);
497
498/**
499 * Get the library version.
500 *
501 * @param major Major version.
502 * @param minor Minor version.
503 * @param patch Patch version.
504 **/
505OHMD_APIENTRYDLL void OHMD_APIENTRY ohmd_get_version(int* out_major, int* out_minor, int* out_patch);
506
507/**
508 * Check that the library is compatible with the required version.
509 *
510 * @param major Required major version.
511 * @param minor Required minor version.
512 * @param patch Required patch version.
513 * @return OMHD_S_OK if the version is compatible or OHMD_S_UNSUPPORTED if it's not.
514 **/
515OHMD_APIENTRYDLL ohmd_status OHMD_APIENTRY ohmd_require_version(int major, int minor, int patch);
516
517/**
518 * Sleep for the given amount of seconds.
519 *
520 * @param time Time to sleep in seconds.
521 **/
522OHMD_APIENTRYDLL void OHMD_APIENTRY ohmd_sleep(double time);
523
524#ifdef __cplusplus
525}
526#endif
527
528#endif
ohmd_float_value
Definition openhmd.h:110
@ OHMD_UNIVERSAL_ABERRATION_K
Definition openhmd.h:172
@ OHMD_POSITION_VECTOR
Definition openhmd.h:129
@ OHMD_RIGHT_EYE_ASPECT_RATIO
Definition openhmd.h:148
@ OHMD_LEFT_EYE_GL_PROJECTION_MATRIX
Definition openhmd.h:123
@ OHMD_RIGHT_EYE_FOV
Definition openhmd.h:146
@ OHMD_ANGULAR_ACCELERATION_VECTOR
Definition openhmd.h:187
@ OHMD_PROJECTION_ZFAR
Definition openhmd.h:154
@ OHMD_EYE_IPD
Definition openhmd.h:151
@ OHMD_LENS_HORIZONTAL_SEPARATION
Definition openhmd.h:137
@ OHMD_VELOCITY_VECTOR
Definition openhmd.h:178
@ OHMD_LEFT_EYE_FOV
Definition openhmd.h:142
@ OHMD_RIGHT_EYE_GL_MODELVIEW_MATRIX
Definition openhmd.h:119
@ OHMD_RIGHT_EYE_GL_PROJECTION_MATRIX
Definition openhmd.h:126
@ OHMD_SCREEN_VERTICAL_SIZE
Definition openhmd.h:134
@ OHMD_CONTROLS_STATE
Definition openhmd.h:175
@ OHMD_UNIVERSAL_DISTORTION_K
Definition openhmd.h:169
@ OHMD_ROTATION_QUAT
Definition openhmd.h:112
@ OHMD_ACCELERATION_VECTOR
Definition openhmd.h:181
@ OHMD_EXTERNAL_SENSOR_FUSION
Definition openhmd.h:166
@ OHMD_LEFT_EYE_ASPECT_RATIO
Definition openhmd.h:144
@ OHMD_LENS_VERTICAL_POSITION
Definition openhmd.h:139
@ OHMD_DISTORTION_K
Definition openhmd.h:159
@ OHMD_ANGULAR_VELOCITY_VECTOR
Definition openhmd.h:184
@ OHMD_SCREEN_HORIZONTAL_SIZE
Definition openhmd.h:132
@ OHMD_PROJECTION_ZNEAR
Definition openhmd.h:156
@ OHMD_LEFT_EYE_GL_MODELVIEW_MATRIX
Definition openhmd.h:116
OHMD_APIENTRYDLL ohmd_device *OHMD_APIENTRY ohmd_list_open_device_s(ohmd_context *ctx, int index, ohmd_device_settings *settings)
OHMD_APIENTRYDLL int OHMD_APIENTRY ohmd_device_geti(ohmd_device *device, ohmd_int_value type, int *out)
ohmd_device_class
Definition openhmd.h:233
@ OHMD_DEVICE_CLASS_CONTROLLER
Definition openhmd.h:237
@ OHMD_DEVICE_CLASS_GENERIC_TRACKER
Definition openhmd.h:239
@ OHMD_DEVICE_CLASS_HMD
Definition openhmd.h:235
ohmd_string_value
Definition openhmd.h:54
OHMD_APIENTRYDLL int OHMD_APIENTRY ohmd_device_setf(ohmd_device *device, ohmd_float_value type, const float *in)
OHMD_APIENTRYDLL void OHMD_APIENTRY ohmd_ctx_update(ohmd_context *ctx)
struct ohmd_context ohmd_context
Definition openhmd.h:255
OHMD_APIENTRYDLL int OHMD_APIENTRY ohmd_device_set_data(ohmd_device *device, ohmd_data_value type, const void *in)
OHMD_APIENTRYDLL ohmd_device *OHMD_APIENTRY ohmd_list_open_device(ohmd_context *ctx, int index)
ohmd_int_settings
Definition openhmd.h:225
@ OHMD_IDS_AUTOMATIC_UPDATE
Definition openhmd.h:228
OHMD_APIENTRYDLL ohmd_context *OHMD_APIENTRY ohmd_ctx_create(void)
OHMD_APIENTRYDLL int OHMD_APIENTRY ohmd_ctx_probe(ohmd_context *ctx)
ohmd_int_value
Definition openhmd.h:191
@ OHMD_DEVICE_CLASS
Definition openhmd.h:198
@ OHMD_DEVICE_FLAGS
Definition openhmd.h:200
@ OHMD_SCREEN_VERTICAL_RESOLUTION
Definition openhmd.h:195
@ OHMD_CONTROLS_TYPES
Definition openhmd.h:209
@ OHMD_CONTROL_COUNT
Definition openhmd.h:203
@ OHMD_CONTROLS_HINTS
Definition openhmd.h:206
@ OHMD_SCREEN_HORIZONTAL_RESOLUTION
Definition openhmd.h:193
OHMD_APIENTRYDLL int OHMD_APIENTRY ohmd_device_set_haptics_on(ohmd_device *device, float duration, float frequency, float amplitude)
ohmd_control_type
Definition openhmd.h:92
OHMD_APIENTRYDLL ohmd_device_settings *OHMD_APIENTRY ohmd_device_settings_create(ohmd_context *ctx)
OHMD_APIENTRYDLL int OHMD_APIENTRY ohmd_device_seti(ohmd_device *device, ohmd_int_value type, const int *in)
OHMD_APIENTRYDLL int OHMD_APIENTRY ohmd_device_getf(ohmd_device *device, ohmd_float_value type, float *out)
ohmd_status
Definition openhmd.h:42
@ OHMD_S_USER_RESERVED
Definition openhmd.h:50
OHMD_APIENTRYDLL void OHMD_APIENTRY ohmd_device_settings_destroy(ohmd_device_settings *settings)
OHMD_APIENTRYDLL int ohmd_gets(ohmd_string_description type, const char **out)
struct ohmd_device ohmd_device
Definition openhmd.h:258
ohmd_device_flags
Definition openhmd.h:244
@ OHMD_DEVICE_FLAGS_NULL_DEVICE
Definition openhmd.h:246
OHMD_APIENTRYDLL int OHMD_APIENTRY ohmd_close_device(ohmd_device *device)
ohmd_control_hint
Definition openhmd.h:72
OHMD_APIENTRYDLL ohmd_status OHMD_APIENTRY ohmd_require_version(int major, int minor, int patch)
OHMD_APIENTRYDLL void OHMD_APIENTRY ohmd_sleep(double time)
OHMD_APIENTRYDLL void OHMD_APIENTRY ohmd_ctx_destroy(ohmd_context *ctx)
OHMD_APIENTRYDLL const char *OHMD_APIENTRY ohmd_ctx_get_error(ohmd_context *ctx)
OHMD_APIENTRYDLL ohmd_status OHMD_APIENTRY ohmd_device_settings_seti(ohmd_device_settings *settings, ohmd_int_settings key, const int *val)
struct ohmd_device_settings ohmd_device_settings
Definition openhmd.h:261
OHMD_APIENTRYDLL int OHMD_APIENTRY ohmd_list_geti(ohmd_context *ctx, int index, ohmd_int_value type, int *out)
OHMD_APIENTRYDLL const char *OHMD_APIENTRY ohmd_list_gets(ohmd_context *ctx, int index, ohmd_string_value type)
ohmd_data_value
Definition openhmd.h:213
@ OHMD_DRIVER_DATA
Definition openhmd.h:215
@ OHMD_DRIVER_PROPERTIES
Definition openhmd.h:222
OHMD_APIENTRYDLL int OHMD_APIENTRY ohmd_device_set_haptics_off(ohmd_device *device)
OHMD_APIENTRYDLL void OHMD_APIENTRY ohmd_get_version(int *out_major, int *out_minor, int *out_patch)
ohmd_string_description
Definition openhmd.h:61